/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.myapp.struts.Admin;

import com.myapp.struts.ConnectDB;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author cuong
 */
public class DataOperation {

    private Statement st;
    private ResultSet rs;

    public DataOperation() {
        ConnectDB objConnectDB = new ConnectDB();
        st = objConnectDB.ConnectionDB();
    }

    public ResultSet getAdminInfo(String username, String password) {
        rs = null;
        String sql= "SELECT * FROM [USER] WHERE [IsAdmin] = 1 AND [IsActive] = 1 AND [FullName] = '" + username + "' AND [Password] = '" + password + "'";
        try {
            rs = st.executeQuery(sql);
        } catch(SQLException ex){
            ex.printStackTrace();
        }
        return rs;
    }
}
